# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=spglib
pkgver=1.16.2
pkgrel=1
pkgdesc='C library for finding and handling crystal symmetries'
arch=(x86_64)
url='https://atztogo.github.io/spglib/'
license=(custom)
depends=(glibc)
makedepends=(cmake)
source=(https://github.com/atztogo/spglib/archive/v$pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('5723789bee7371ebba91d78c729d2a608f198fad5e1c95eebe18fda9f2914ec8')

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
  install -Dm644 "$srcdir"/$pkgname-$pkgver/COPYING "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
